﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Yun.IM.Response;
using Yun.Interface;
using Yun.Util;

namespace Yun.IM.Request
{
    /// <summary>
    /// 获取收藏列表
    /// yun.im.rongcloud.collect.list.get
    /// </summary>
    public class GetIMCollectsRequest : ITopRequest<GetIMCollectsResponse>
    {
        /// <summary>
        /// 页码
        /// </summary>
        public int PageNum { get; set; } = 1;

        /// <summary>
        /// 页容量
        /// </summary>
        public int PageSize { get; set; } = 1;

        /// <summary>
        /// 来源用户ID
        /// </summary>
        public long? SourceUserId { get; set; }

        /// <summary>
        /// 消息类型
        /// 消息类型，文本消息 RC:TxtMsg 、 图片消息 RC:ImgMsg 、语音消息 RC:VcMsg 、图文消息 RC:ImgTextMsg 、位置消息 RC:LBSMsg 、添加联系人消息 RC:ContactNtf 、提示条通知消息 RC:InfoNtf 、资料通知消息 RC:ProfileNtf 、通用命令通知消息 RC:CmdNtf 、客服握手消息 RC:HsMsg 、客服挂断消息 RC:SpMsg
        /// </summary>
        public string ObjectName { get; set; }

        public void Validate()
        {
            RequestValidator.ValidateMaxValue("pagesize", PageSize, 1000);
        }

        public string GetApiName()
        {
            return "yun.im.rongcloud.collect.list.get";
        }

        public IDictionary<string, string> GetParameters()
        {
            var parameters = new YunDictionary
            {
                {"pagenum", PageNum},
                {"pagesize", PageSize},
                {"sourceuserid", SourceUserId},
                {"objectname", ObjectName} 
            }; 
            return parameters;
        }


    }
}
